Conversation
|
Size Change: 0 B Total Size: 2.31 MB ℹ️ View Unchanged
|
eugene-manuilov
left a comment
There was a problem hiding this comment.
Mostly looks good, but found two minor issues. Please, take a look.
| } | ||
|
|
||
| if ( ! error ) { | ||
| registry.dispatch( CORE_SITE ).resetEligibleSubscribers(); |
There was a problem hiding this comment.
| registry.dispatch( CORE_SITE ).resetEligibleSubscribers(); | |
| yield registry.dispatch( CORE_SITE ).resetEligibleSubscribers(); |
There was a problem hiding this comment.
We don't use yield for dispatch, we included the rule to prevent it:
error Only plain objects should be yielded from action generator functions. dispatch always returns a Promise sitekit/no-yield-dispatchThere was a problem hiding this comment.
Ah... okay, didn't see it. Then: yield commonActions.await( registry.dispatch( ... ) )
There was a problem hiding this comment.
Actually, no, without yield, just await it to avoid possible race conditions:
commonActions.await( registry.dispatch( ... ) )
|
|
||
| if ( ! error ) { | ||
| const registry = yield commonActions.getRegistry(); | ||
| registry.dispatch( CORE_SITE ).resetEligibleSubscribers(); |
There was a problem hiding this comment.
| registry.dispatch( CORE_SITE ).resetEligibleSubscribers(); | |
| yield registry.dispatch( CORE_SITE ).resetEligibleSubscribers(); |
There was a problem hiding this comment.
Same here: yield commonActions.await( registry.dispatch ( ... ) )
There was a problem hiding this comment.
Same here, without yield to avoid race conditions:
commonActions.await( registry.dispatch ( ... ) )
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist